home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 April / ME_2011_04.iso / [Video-Tutorial] / 9430830 / bookmarks.swf / scripts / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2009-11-16  |  31.8 KB  |  826 lines

  1. function setStartScreen()
  2. {
  3.    header_op.textColor = _root.parseColor(_root.submenu_header_color);
  4.    header_op.text = _root.my_bm_label;
  5.    subheader_op.textColor = _root.parseColor(_root.submenu_subheader_color);
  6.    setRGB(header_line_mc,_root.parseColor(_root.seperator_line_color));
  7.    header_line_mc._alpha = Number(_root.seperator_line_alpha);
  8.    info_mc.header_op.textColor = _root.parseColor(_root.teaser_header_color);
  9.    info_mc.header_op.text = _root.my_bm_teaser_info_label;
  10.    info_mc.subheader_op.textColor = _root.parseColor(_root.teaser_subheader_color);
  11.    info_mc.bm_header_op.textColor = _root.parseColor(_root.teaser_subheader2_color);
  12.    info_mc.bm_text_op.textColor = _root.parseColor(_root.teaser_text_color);
  13.    info_mc.bm_time_op.textColor = _root.parseColor(_root.teaser_text_color);
  14.    info_mc.bm_alert_op.textColor = _root.parseColor(_root.teaser_text_color);
  15.    setRGB(info_mc.info_v_line_mc,_root.parseColor(_root.seperator_line_color));
  16.    info_mc.info_v_line_mc._alpha = Number(_root.seperator_line_alpha);
  17.    setRGB(info_mc.info_line_mc,_root.parseColor(_root.seperator_line_color));
  18.    info_mc.info_line_mc._alpha = Number(_root.seperator_line_alpha);
  19.    setRGB(info_mc.footer_line_mc,_root.parseColor(_root.seperator_line_color));
  20.    info_mc.footer_line_mc._alpha = Number(_root.seperator_line_alpha);
  21.    setRGB(info_mc.bm_header_bg_mc,_root.parseColor(_root.form_highlight_color));
  22.    info_mc.bm_header_bg_mc._alpha = _root.form_highlight_alpha;
  23.    setRGB(info_mc.bm_text_bg_mc,_root.parseColor(_root.form_highlight_color));
  24.    info_mc.bm_text_bg_mc._alpha = _root.form_highlight_alpha;
  25.    legende_mc.text1_op.autoSize = true;
  26.    legende_mc.text1_op.textColor = _root.parseColor(_root.teaser_subheader_color);
  27.    legende_mc.text1_op.text = _root.my_bm_legend_desc;
  28.    legende_mc.text2_op.autoSize = true;
  29.    legende_mc.text2_op.textColor = _root.parseColor(_root.teaser_subheader_color);
  30.    legende_mc.text2_op.text = _root.my_bm_pd_legend_desc;
  31.    if(_root.my_bm_show_legend == "false")
  32.    {
  33.       legende_mc._visible = false;
  34.    }
  35.    else
  36.    {
  37.       if(v2b_so.data.my_bm_show_predefined_bm == undefined || v2b_so.data.my_bm_show_predefined_bm == true)
  38.       {
  39.          v2b_so.data.my_bm_show_predefined_bm = true;
  40.          v2b_so.flush();
  41.          show_predefined_bm = true;
  42.       }
  43.       else
  44.       {
  45.          show_predefined_bm = false;
  46.          legende_mc.check_box_mc.checked_mc._visible = false;
  47.       }
  48.       legende_mc.check_box_mc.onRelease = pdCheckBox_onClick;
  49.    }
  50. }
  51. function pdCheckBox_onClick()
  52. {
  53.    if(show_predefined_bm)
  54.    {
  55.       show_predefined_bm = false;
  56.       legende_mc.check_box_mc.checked_mc._visible = false;
  57.       v2b_so.data.my_bm_show_predefined_bm = false;
  58.    }
  59.    else
  60.    {
  61.       show_predefined_bm = true;
  62.       legende_mc.check_box_mc.checked_mc._visible = true;
  63.       v2b_so.data.my_bm_show_predefined_bm = true;
  64.    }
  65.    v2b_so.flush();
  66.    renderBookmarks();
  67. }
  68. function renderBookmarks()
  69. {
  70.    removeBookmarks();
  71.    var _loc10_ = 16;
  72.    var _loc15_ = 0;
  73.    bookmark_holder_mc._visible = false;
  74.    i = 0;
  75.    while(i < video_array.length)
  76.    {
  77.       var _loc8_ = undefined;
  78.       if(video_array[i].movie.lastIndexOf("/") > -1)
  79.       {
  80.          _loc8_ = video_array[i].movie.substring(video_array[i].movie.lastIndexOf("/") + 1,video_array[i].movie.lastIndexOf("."));
  81.       }
  82.       else
  83.       {
  84.          _loc8_ = video_array[i].movie.substring(0,video_array[i].movie.lastIndexOf("."));
  85.       }
  86.       var _loc9_ = _loc8_ + "_data";
  87.       var _loc5_ = new Array();
  88.       if(v2b_so.data[_loc9_].bookmarks != undefined && v2b_so.data[_loc9_].bookmarks.length > 0)
  89.       {
  90.          _loc5_ = v2b_so.data[_loc9_].bookmarks;
  91.       }
  92.       if(show_predefined_bm)
  93.       {
  94.          if(_root.pd_bm_object[_loc8_] != undefined && _root.pd_bm_object[_loc8_].length > 0)
  95.          {
  96.             _loc5_ = _loc5_.concat(_root.pd_bm_object[_loc8_]);
  97.             _loc5_.sortOn("sec",Array.NUMERIC);
  98.          }
  99.       }
  100.       if(_loc5_.length > 0)
  101.       {
  102.          var _loc6_ = bookmark_holder_mc.attachMovie("headline_mc","headline" + i,bookmark_holder_mc.getNextHighestDepth());
  103.          _loc6_.mc_type = "headline";
  104.          _loc6_._x = 0;
  105.          _loc6_._y = _loc10_;
  106.          _loc6_.original_text = video_array[i].movie_name;
  107.          _loc6_.chapter_op.textColor = _root.parseColor(_root.index_color);
  108.          _loc6_.chapter_op.text = video_array[i].chapter_id;
  109.          if(_loc6_.chapter_op.textWidth + 2 > _loc6_.chapter_op._width)
  110.          {
  111.             _loc6_.chapter_op.autoSize = true;
  112.             _loc6_.text_op._x = Math.ceil(_loc6_.chapter_op._x + _loc6_.chapter_op._width + 3);
  113.          }
  114.          _loc6_.text_op._width = max_content_width - _loc6_.text_op._x;
  115.          _loc6_.text_op.textColor = _root.parseColor(_root.submenu_color);
  116.          _loc6_.text_op.text = _loc6_.original_text;
  117.          _loc6_.text_op.stringCutter_advanced(" ...");
  118.          var _loc11_ = 0;
  119.          var _loc12_ = 0;
  120.          var _loc4_ = 0;
  121.          while(_loc4_ < _loc5_.length)
  122.          {
  123.             _loc15_ = _loc15_ + 1;
  124.             _loc10_ += bm_y_dis;
  125.             var _loc3_ = bookmark_holder_mc.attachMovie("bookmark_mc","bookmark" + i + "-" + _loc4_,bookmark_holder_mc.getNextHighestDepth());
  126.             _loc3_.mc_type = "bookmark";
  127.             _loc3_.movie_id = i;
  128.             if(_loc5_[_loc4_].pd == true)
  129.             {
  130.                _loc3_.pd = true;
  131.                _loc3_.array_id = _loc12_;
  132.                _loc3_.array_name = _loc8_;
  133.                _loc12_ = _loc12_ + 1;
  134.                _loc3_.edit_btn_mc._visible = false;
  135.                _loc3_.delete_btn_mc._visible = false;
  136.                setRGB(_loc3_.bm_icon_mc,3407871);
  137.             }
  138.             else
  139.             {
  140.                _loc3_.pd = false;
  141.                _loc3_.array_id = _loc11_;
  142.                _loc3_.array_name = _loc9_;
  143.                _loc11_ = _loc11_ + 1;
  144.             }
  145.             setRGB(_loc3_.bg_mc,_root.parseColor(_root.submenu_rollover_color));
  146.             _loc3_.bg_mc._alpha = 0;
  147.             setRGB(_loc3_.edit_btn_mc.bg_mc,_root.parseColor(_root.submenu_rollover_color));
  148.             _loc3_.edit_btn_mc.bg_mc._alpha = 0;
  149.             setRGB(_loc3_.delete_btn_mc.bg_mc,_root.parseColor(_root.submenu_rollover_color));
  150.             _loc3_.delete_btn_mc.bg_mc._alpha = 0;
  151.             _loc3_._x = 0;
  152.             _loc3_._y = _loc10_;
  153.             setBookmarkWidth(_loc3_,max_content_width,false);
  154.             _loc3_.original_text = _loc5_[_loc4_].description;
  155.             _loc3_.sec = _loc5_[_loc4_].sec;
  156.             _loc3_.text_op.textColor = _root.parseColor(_root.submenu_color);
  157.             _loc3_.text_op.text = _loc3_.original_text;
  158.             _loc3_.text_op.stringCutter_advanced(" ...");
  159.             _loc3_.date_op.textColor = _root.parseColor(_root.submenu_color);
  160.             if(_loc5_[_loc4_].bm_date != undefined)
  161.             {
  162.                _loc3_.date_op.text = _loc5_[_loc4_].bm_date;
  163.             }
  164.             else
  165.             {
  166.                _loc3_.date_op.text = "";
  167.             }
  168.             _loc3_.time_op.textColor = _root.parseColor(_root.submenu_color);
  169.             _loc3_.time_op.text = createTimeString(_loc5_[_loc4_].sec);
  170.             _loc3_.bg_mc.onRelease = function()
  171.             {
  172.                _root.killToolTip();
  173.                gotoBookmark(this._parent.movie_id,this._parent.array_name,this._parent.array_id,this._parent.pd);
  174.             };
  175.             _loc3_.bg_mc.onRollOver = _loc3_.bg_mc.onDragOver = function()
  176.             {
  177.                if(!editing_active)
  178.                {
  179.                   this._parent.bg_mc._alpha = Number(_root.submenu_rollover_alpha);
  180.                   this._parent.text_op.textColor = _root.parseColor(_root.submenu_rollover_color);
  181.                   this._parent.time_op.textColor = _root.parseColor(_root.submenu_rollover_color);
  182.                   this._parent.date_op.textColor = _root.parseColor(_root.submenu_rollover_color);
  183.                   var _loc3_ = {x:this._parent.bg_mc._x + this._parent.bg_mc._width - 26,y:0};
  184.                   this._parent.localToGlobal(_loc3_);
  185.                   local_root_mc.globalToLocal(_loc3_);
  186.                   _root.toolTip(_root.my_bm_start_video_desc,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
  187.                   infotext_delay = setTimeout(setBookmarkInfoText,250,this._parent.array_name,this._parent.array_id,this._parent.pd);
  188.                }
  189.             };
  190.             _loc3_.bg_mc.onRollOut = _loc3_.bg_mc.onDragOut = function()
  191.             {
  192.                _root.killToolTip();
  193.                if(!editing_active)
  194.                {
  195.                   this._parent.bg_mc._alpha = 0;
  196.                   this._parent.text_op.textColor = _root.parseColor(_root.submenu_color);
  197.                   this._parent.time_op.textColor = _root.parseColor(_root.submenu_color);
  198.                   this._parent.date_op.textColor = _root.parseColor(_root.submenu_color);
  199.                   hideBookmarkInfoText();
  200.                }
  201.             };
  202.             _loc3_.edit_btn_mc.onRelease = function()
  203.             {
  204.                _root.killToolTip();
  205.                if(!editing_active)
  206.                {
  207.                   selected_bookmark = this._parent;
  208.                   this.bg_mc._alpha = 0;
  209.                   openBookmarkEditField();
  210.                }
  211.             };
  212.             _loc3_.edit_btn_mc.onRollOver = _loc3_.edit_btn_mc.onDragOver = function()
  213.             {
  214.                if(!editing_active)
  215.                {
  216.                   _root.killToolTip();
  217.                   var _loc3_ = {x:0,y:0};
  218.                   this.localToGlobal(_loc3_);
  219.                   local_root_mc.globalToLocal(_loc3_);
  220.                   _root.toolTip(_root.edit_bookmark_desc,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
  221.                   this.bg_mc._alpha = Number(_root.submenu_rollover_alpha);
  222.                   infotext_delay = setTimeout(setBookmarkInfoText,250,this._parent.array_name,this._parent.array_id);
  223.                }
  224.             };
  225.             _loc3_.edit_btn_mc.onRollOut = _loc3_.edit_btn_mc.onDragOut = function()
  226.             {
  227.                _root.killToolTip();
  228.                this.bg_mc._alpha = 0;
  229.                if(!editing_active)
  230.                {
  231.                   hideBookmarkInfoText();
  232.                }
  233.             };
  234.             _loc3_.delete_btn_mc.onRelease = function()
  235.             {
  236.                _root.killToolTip();
  237.                if(!editing_active)
  238.                {
  239.                   selected_bookmark = this._parent;
  240.                   this.bg_mc._alpha = 0;
  241.                   openBookmarkDeleteField();
  242.                }
  243.             };
  244.             _loc3_.delete_btn_mc.onRollOver = _loc3_.delete_btn_mc.onDragOver = function()
  245.             {
  246.                if(!editing_active)
  247.                {
  248.                   _root.killToolTip();
  249.                   var _loc3_ = {x:0,y:0};
  250.                   this.localToGlobal(_loc3_);
  251.                   local_root_mc.globalToLocal(_loc3_);
  252.                   _root.toolTip(_root.bookmark_del_desc,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
  253.                   this.bg_mc._alpha = Number(_root.submenu_rollover_alpha);
  254.                   infotext_delay = setTimeout(setBookmarkInfoText,250,this._parent.array_name,this._parent.array_id);
  255.                }
  256.             };
  257.             _loc3_.delete_btn_mc.onRollOut = _loc3_.delete_btn_mc.onDragOut = function()
  258.             {
  259.                _root.killToolTip();
  260.                this.bg_mc._alpha = 0;
  261.                if(!editing_active)
  262.                {
  263.                   hideBookmarkInfoText();
  264.                }
  265.             };
  266.             _loc4_ = _loc4_ + 1;
  267.          }
  268.          _loc10_ += hl_y_dis;
  269.       }
  270.       i++;
  271.    }
  272.    if(_loc15_ == 0)
  273.    {
  274.       subheader_op.text = _root.my_bm_no_bookmarks_desc;
  275.       info_mc.subheader_op.text = "";
  276.    }
  277.    else
  278.    {
  279.       bookmark_holder_mc.attachMovie("headline_mc","dummy",bookmark_holder_mc.getNextHighestDepth());
  280.       bookmark_holder_mc.dummy._y = _loc10_;
  281.       bookmark_holder_mc.dummy.text_op.autoSize = true;
  282.       subheader_op.text = _root.my_bm_desc;
  283.       info_mc.subheader_op.text = _root.my_bm_teaser_info_desc;
  284.    }
  285.    bookmark_holder_mc._visible = true;
  286.    bm_scroller.targetHeight = Math.ceil(bookmark_holder_mc._height);
  287.    bm_scroller.targetWidth = Math.ceil(bookmark_holder_mc._width);
  288. }
  289. function removeBookmarks()
  290. {
  291.    for(var _loc1_ in bookmark_holder_mc)
  292.    {
  293.       bookmark_holder_mc[_loc1_].removeMovieClip();
  294.    }
  295.    bm_scroller.targetHeight = Math.ceil(bookmark_holder_mc._height);
  296.    bm_scroller.targetWidth = Math.ceil(bookmark_holder_mc._width);
  297. }
  298. function reRenderBookmark(bm_mc)
  299. {
  300.    var _loc2_ = v2b_so.data[bm_mc.array_name].bookmarks;
  301.    bm_mc.original_text = _loc2_[selected_bookmark.array_id].description;
  302.    bm_mc.sec = _loc2_[selected_bookmark.array_id].sec;
  303.    bm_mc.text_op.text = bm_mc.original_text;
  304.    bm_mc.text_op.stringCutter_advanced(" ...");
  305.    if(_loc2_[selected_bookmark.array_id].bm_date != undefined)
  306.    {
  307.       bm_mc.date_op.text = _loc2_[selected_bookmark.array_id].bm_date;
  308.    }
  309.    else
  310.    {
  311.       bm_mc.date_op.text = "";
  312.    }
  313.    bm_mc.time_op.text = createTimeString(_loc2_[selected_bookmark.array_id].sec);
  314. }
  315. function setBookmarkInfoText(array_name, array_id, pd)
  316. {
  317.    var _loc2_ = undefined;
  318.    if(pd)
  319.    {
  320.       _loc2_ = _root.pd_bm_object[array_name][array_id];
  321.    }
  322.    else
  323.    {
  324.       _loc2_ = v2b_so.data[array_name].bookmarks[array_id];
  325.    }
  326.    info_mc.bm_header_op.text = _loc2_.description;
  327.    info_mc.bm_text_op._y = Math.round(info_mc.bm_header_op._y + info_mc.bm_header_op._height + 9);
  328.    info_mc.bm_text_op.text = _loc2_.memo;
  329.    if(info_mc.bm_text_op._y + info_mc.bm_text_op._height > parent_container_height - 150)
  330.    {
  331.       info_mc.bm_text_op.autoSize = false;
  332.       info_mc.bm_text_op._height = Math.max(17,parent_container_height - 150 - info_mc.bm_text_op._y);
  333.    }
  334.    info_mc.bm_time_op._y = Math.round(info_mc.bm_text_op._y + info_mc.bm_text_op._height + 18);
  335.    info_mc.bm_time_op.text = createTimeString(_loc2_.sec);
  336.    info_mc.footer_line_mc._y = info_mc.bm_time_op._y + 40;
  337.    info_mc.footer_line_mc._visible = true;
  338. }
  339. function hideBookmarkInfoText()
  340. {
  341.    clearInterval(infotext_delay);
  342.    info_mc.bm_header_op.text = "";
  343.    info_mc.bm_text_op.text = "";
  344.    info_mc.bm_text_op.autoSize = true;
  345.    info_mc.bm_time_op.text = "";
  346.    info_mc.footer_line_mc._visible = false;
  347.    info_mc.bm_text_op._width = 236;
  348.    info_mc.bm_text_bg_mc._visible = false;
  349.    info_mc.bm_header_bg_mc._visible = false;
  350.    info_mc.text_scroller.enabled = false;
  351.    info_mc.text_scroller._visible = false;
  352.    clearInterval(text_scroller_delay);
  353. }
  354. function disableBookmarks()
  355. {
  356.    for(var _loc1_ in bookmark_holder_mc)
  357.    {
  358.       if(bookmark_holder_mc[_loc1_].mc_type == "bookmark")
  359.       {
  360.          bookmark_holder_mc[_loc1_].bg_mc.enabled = false;
  361.          if(bookmark_holder_mc[_loc1_] != selected_bookmark)
  362.          {
  363.             bookmark_holder_mc[_loc1_]._alpha = 30;
  364.          }
  365.          bookmark_holder_mc[_loc1_].delete_btn_mc.enabled = false;
  366.          bookmark_holder_mc[_loc1_].edit_btn_mc.enabled = false;
  367.       }
  368.       else
  369.       {
  370.          bookmark_holder_mc[_loc1_]._alpha = 30;
  371.       }
  372.    }
  373. }
  374. function gotoBookmark(movie_id, array_name, array_id, pd)
  375. {
  376.    var _loc10_ = video_array[movie_id].movie_name;
  377.    var _loc8_ = video_array[movie_id].movie;
  378.    var _loc9_ = video_array[movie_id].chapter_id;
  379.    var _loc3_ = _loc9_.split(".");
  380.    if(_loc3_.length > 0 && isNaN(Number(_loc3_[_loc3_.length - 1])))
  381.    {
  382.       _loc3_.splice(_loc3_.length - 1,1);
  383.    }
  384.    var _loc4_ = _root.cd_content.firstChild;
  385.    if(_loc3_.length > 1)
  386.    {
  387.       var _loc2_ = 0;
  388.       while(_loc2_ < _loc3_.length - 1)
  389.       {
  390.          _loc4_ = _loc4_.childNodes[_loc3_[_loc2_] - 1];
  391.          _loc2_ = _loc2_ + 1;
  392.       }
  393.    }
  394.    var _loc6_ = 0;
  395.    var _loc5_ = undefined;
  396.    if(pd)
  397.    {
  398.       _loc5_ = _root.pd_bm_object[array_name][array_id];
  399.    }
  400.    else
  401.    {
  402.       _loc5_ = v2b_so.data[array_name].bookmarks[array_id];
  403.    }
  404.    if(_loc5_ != undefined)
  405.    {
  406.       _loc6_ = _loc5_.sec;
  407.    }
  408.    _root.renderVideoBookmark(_loc4_,_loc8_,_loc10_,_loc6_);
  409. }
  410. function openBookmarkEditField()
  411. {
  412.    editing_active = true;
  413.    clearInterval(infotext_delay);
  414.    disableBookmarks();
  415.    var _loc4_ = selected_bookmark.array_name;
  416.    var _loc6_ = v2b_so.data[_loc4_].bookmarks;
  417.    var _loc5_ = v2b_so.data[_loc4_].bookmarks[selected_bookmark.array_id];
  418.    info_mc.bm_header_op.text = _loc5_.description;
  419.    info_mc.bm_text_op.text = _loc5_.memo;
  420.    info_mc.bm_header_op.autoSize = false;
  421.    info_mc.bm_header_op._height = 37;
  422.    info_mc.bm_header_op.type = "input";
  423.    info_mc.bm_header_op.maxChars = 100;
  424.    info_mc.bm_header_op.selectable = true;
  425.    info_mc.bm_header_op.textColor = _root.parseColor(_root.form_text_color);
  426.    info_mc.bm_text_op.autoSize = false;
  427.    info_mc.bm_text_op._y = Math.round(info_mc.bm_header_op._y + info_mc.bm_header_op._height + 8);
  428.    info_mc.bm_text_op._height = 156;
  429.    info_mc.bm_text_op._width = 218;
  430.    info_mc.bm_text_op.type = "input";
  431.    info_mc.bm_text_op.maxChars = 500;
  432.    info_mc.bm_text_op.selectable = true;
  433.    info_mc.bm_text_op.textColor = _root.parseColor(_root.form_text_color);
  434.    info_mc.bm_header_bg_mc._x = info_mc.bm_header_op._x - 2;
  435.    info_mc.bm_header_bg_mc._y = info_mc.bm_header_op._y - 3;
  436.    info_mc.bm_header_bg_mc._width = Math.round(info_mc.bm_header_op._width + 4);
  437.    info_mc.bm_header_bg_mc._height = Math.round(info_mc.bm_header_op._height + 4);
  438.    info_mc.bm_header_bg_mc._visible = true;
  439.    info_mc.bm_text_bg_mc._x = info_mc.bm_text_op._x - 2;
  440.    info_mc.bm_text_bg_mc._y = info_mc.bm_text_op._y - 3;
  441.    info_mc.bm_text_bg_mc._width = Math.round(info_mc.bm_text_op._width + 6 + 16);
  442.    info_mc.bm_text_bg_mc._height = Math.round(info_mc.bm_text_op._height + 4);
  443.    info_mc.bm_text_bg_mc._visible = true;
  444.    text_scroller_delay = setTimeout(setTextScoller,200);
  445.    info_mc.bm_time_op._y = Math.round(info_mc.bm_text_op._y + info_mc.bm_text_op._height + 18);
  446.    info_mc.footer_line_mc._y = info_mc.bm_time_op._y + 40;
  447.    info_mc.footer_line_mc._visible = false;
  448.    var _loc2_ = info_mc.attachMovie("movie_navigation_btn","bookmark_save_btn",info_mc.getNextHighestDepth());
  449.    _loc2_._x = info_mc.bm_text_bg_mc._x;
  450.    _loc2_._y = info_mc.footer_line_mc._y;
  451.    _loc2_.text_op.autoSize = true;
  452.    _loc2_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  453.    _loc2_.text_op.text = _root.bookmark_save_button_desc;
  454.    _loc2_.btn_bg_mc._width = Math.round(info_mc.bm_text_bg_mc._width / 2) - 2;
  455.    _loc2_.btn_rollover_mc._width = _loc2_.btn_bg_mc._width;
  456.    _loc2_.btn_pressed_mc._width = _loc2_.btn_bg_mc._width;
  457.    _loc2_.text_op._x = Math.floor((_loc2_.btn_bg_mc._width - _loc2_.text_op.textWidth) / 2) - 2;
  458.    setRGB(_loc2_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  459.    _loc2_.btn_rollover_mc._alpha = 0;
  460.    _loc2_.btn_pressed_mc._alpha = 0;
  461.    _loc2_.onRelease = bookmarkEditField_onSave;
  462.    _loc2_.onRollOver = _loc2_.onDragOver = navigationButton_onRollOver;
  463.    _loc2_.onRollOut = _loc2_.onDragOut = navigationButton_onRollOut;
  464.    var _loc3_ = info_mc.attachMovie("movie_navigation_btn","bookmark_cancle_btn",info_mc.getNextHighestDepth());
  465.    _loc3_._x = _loc2_._x + _loc2_._width + 2;
  466.    _loc3_._y = info_mc.footer_line_mc._y;
  467.    _loc3_.text_op.autoSize = true;
  468.    _loc3_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  469.    _loc3_.text_op.text = _root.bookmark_cancle_button_desc;
  470.    _loc3_.btn_bg_mc._width = Math.round(info_mc.bm_text_bg_mc._width - _loc2_.btn_bg_mc._width - 2);
  471.    _loc3_.btn_rollover_mc._width = _loc3_.btn_bg_mc._width;
  472.    _loc3_.btn_pressed_mc._width = _loc3_.btn_bg_mc._width;
  473.    _loc3_.text_op._x = Math.floor((_loc3_.btn_bg_mc._width - _loc3_.text_op.textWidth) / 2) - 2;
  474.    setRGB(_loc3_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  475.    _loc3_.btn_rollover_mc._alpha = 0;
  476.    _loc3_.btn_pressed_mc._alpha = 0;
  477.    _loc3_.onRelease = bookmarkEditField_onClose;
  478.    _loc3_.onRollOver = _loc3_.onDragOver = navigationButton_onRollOver;
  479.    _loc3_.onRollOut = _loc3_.onDragOut = navigationButton_onRollOut;
  480. }
  481. function openBookmarkDeleteField()
  482. {
  483.    editing_active = true;
  484.    clearInterval(infotext_delay);
  485.    disableBookmarks();
  486.    info_mc.footer_line_mc._visible = false;
  487.    info_mc.bm_alert_op._y = info_mc.footer_line_mc._y;
  488.    info_mc.bm_alert_op.autoSize = true;
  489.    info_mc.bm_alert_op.multiline = true;
  490.    info_mc.bm_alert_op.wordWrap = true;
  491.    info_mc.bm_alert_op.text = _root.bookmark_del_question;
  492.    var _loc2_ = info_mc.attachMovie("movie_navigation_btn","bookmark_yes_btn",info_mc.getNextHighestDepth());
  493.    _loc2_._x = info_mc.footer_line_mc._x;
  494.    _loc2_._y = Math.round(info_mc.bm_alert_op._y + info_mc.bm_alert_op.textHeight + 15);
  495.    _loc2_.text_op.autoSize = true;
  496.    _loc2_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  497.    _loc2_.text_op.text = _root.bookmark_del_confirm;
  498.    _loc2_.btn_bg_mc._width = Math.round(info_mc.footer_line_mc._width / 2) - 2;
  499.    _loc2_.btn_rollover_mc._width = _loc2_.btn_bg_mc._width;
  500.    _loc2_.btn_pressed_mc._width = _loc2_.btn_bg_mc._width;
  501.    _loc2_.text_op._x = Math.floor((_loc2_.btn_bg_mc._width - _loc2_.text_op.textWidth) / 2) - 2;
  502.    setRGB(_loc2_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  503.    _loc2_.btn_rollover_mc._alpha = 0;
  504.    _loc2_.btn_pressed_mc._alpha = 0;
  505.    _loc2_.onRelease = bookmarkEditField_onDelete;
  506.    _loc2_.onRollOver = _loc2_.onDragOver = navigationButton_onRollOver;
  507.    _loc2_.onRollOut = _loc2_.onDragOut = navigationButton_onRollOut;
  508.    var _loc3_ = info_mc.attachMovie("movie_navigation_btn","bookmark_no_btn",info_mc.getNextHighestDepth());
  509.    _loc3_._x = _loc2_._x + _loc2_._width + 2;
  510.    _loc3_._y = _loc2_._y;
  511.    _loc3_.text_op.autoSize = true;
  512.    _loc3_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  513.    _loc3_.text_op.text = _root.bookmark_del_negate;
  514.    _loc3_.btn_bg_mc._width = Math.round(info_mc.footer_line_mc._width - _loc2_.btn_bg_mc._width - 2);
  515.    _loc3_.btn_rollover_mc._width = _loc3_.btn_bg_mc._width;
  516.    _loc3_.btn_pressed_mc._width = _loc3_.btn_bg_mc._width;
  517.    _loc3_.text_op._x = Math.floor((_loc3_.btn_bg_mc._width - _loc3_.text_op.textWidth) / 2) - 2;
  518.    setRGB(_loc3_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  519.    _loc3_.btn_rollover_mc._alpha = 0;
  520.    _loc3_.btn_pressed_mc._alpha = 0;
  521.    _loc3_.onRelease = bookmarkEditField_onClose;
  522.    _loc3_.onRollOver = _loc3_.onDragOver = navigationButton_onRollOver;
  523.    _loc3_.onRollOut = _loc3_.onDragOut = navigationButton_onRollOut;
  524. }
  525. function bookmarkEditField_onSave()
  526. {
  527.    var _loc2_ = selected_bookmark.array_name;
  528.    var _loc1_ = v2b_so.data[_loc2_].bookmarks;
  529.    if(_loc1_ != undefined && _loc1_[selected_bookmark.array_id].sec == selected_bookmark.sec)
  530.    {
  531.       _loc1_[selected_bookmark.array_id].description = info_mc.bm_header_op.text;
  532.       _loc1_[selected_bookmark.array_id].memo = info_mc.bm_text_op.text;
  533.       _loc1_[selected_bookmark.array_id].bm_date = createDateString(new Date());
  534.       v2b_so.data[_loc2_].bookmarks = _loc1_;
  535.       v2b_so.flush();
  536.       reRenderBookmark(selected_bookmark);
  537.    }
  538.    else
  539.    {
  540.       renderBookmarks();
  541.    }
  542.    bookmarkEditField_onClose();
  543. }
  544. function bookmarkEditField_onDelete()
  545. {
  546.    var _loc2_ = selected_bookmark.array_name;
  547.    var _loc1_ = v2b_so.data[_loc2_].bookmarks;
  548.    if(_loc1_ != undefined && _loc1_[selected_bookmark.array_id].sec == selected_bookmark.sec)
  549.    {
  550.       _loc1_.splice(selected_bookmark.array_id,1);
  551.       v2b_so.data[_loc2_].bookmarks = new Array();
  552.       if(_loc1_.length > 0)
  553.       {
  554.          v2b_so.data[_loc2_].bookmarks = _loc1_;
  555.       }
  556.       v2b_so.flush();
  557.    }
  558.    bookmarkEditField_onClose();
  559.    renderBookmarks();
  560. }
  561. function bookmarkEditField_onClose()
  562. {
  563.    for(var _loc2_ in bookmark_holder_mc)
  564.    {
  565.       if(bookmark_holder_mc[_loc2_].mc_type == "bookmark")
  566.       {
  567.          bookmark_holder_mc[_loc2_].bg_mc.enabled = true;
  568.          bookmark_holder_mc[_loc2_]._alpha = 100;
  569.          bookmark_holder_mc[_loc2_].delete_btn_mc.enabled = true;
  570.          bookmark_holder_mc[_loc2_].edit_btn_mc.enabled = true;
  571.       }
  572.       else
  573.       {
  574.          bookmark_holder_mc[_loc2_]._alpha = 100;
  575.       }
  576.    }
  577.    info_mc.bookmark_cancle_btn.removeMovieClip();
  578.    info_mc.bookmark_save_btn.removeMovieClip();
  579.    info_mc.bookmark_yes_btn.removeMovieClip();
  580.    info_mc.bookmark_no_btn.removeMovieClip();
  581.    hideBookmarkInfoText();
  582.    info_mc.bm_header_op.autoSize = true;
  583.    info_mc.bm_header_op.type = "dynamic";
  584.    info_mc.bm_header_op.background = false;
  585.    info_mc.bm_header_op.textColor = _root.parseColor(_root.teaser_subheader2_color);
  586.    info_mc.bm_header_op.selectable = false;
  587.    info_mc.bm_text_op.autoSize = true;
  588.    info_mc.bm_text_op.type = "dynamic";
  589.    info_mc.bm_text_op.background = false;
  590.    info_mc.bm_text_op.textColor = _root.parseColor(_root.teaser_text_color);
  591.    info_mc.bm_text_op.selectable = false;
  592.    info_mc.bm_alert_op.text = "";
  593.    editing_active = false;
  594.    selected_bookmark = undefined;
  595. }
  596. function navigationButton_onRollOver()
  597. {
  598.    this.btn_rollover_mc._alpha = 100;
  599. }
  600. function navigationButton_onRollOut()
  601. {
  602.    this.btn_rollover_mc._alpha = 0;
  603. }
  604. function setVisibility(value)
  605. {
  606.    if(value)
  607.    {
  608.       renderBookmarks();
  609.       bookmarkEditField_onClose();
  610.       Mouse.removeListener(ftScrollBarMouseListener);
  611.       Mouse.addListener(ftScrollBarMouseListener);
  612.       this._visible = value;
  613.       if(local_setpos_changelog != _root.setpos_changelog)
  614.       {
  615.          setLocalPos();
  616.       }
  617.    }
  618.    else
  619.    {
  620.       bookmarkEditField_onClose();
  621.       Mouse.removeListener(ftScrollBarMouseListener);
  622.       bm_scroller.scrollPercentage = 0;
  623.       this._visible = value;
  624.    }
  625. }
  626. function setLocalPos()
  627. {
  628.    if(local_root_mc._visible)
  629.    {
  630.       if(local_test)
  631.       {
  632.          parent_container_width = Stage.width;
  633.          parent_container_height = Stage.height;
  634.       }
  635.       else
  636.       {
  637.          parent_container_width = _root.content_pos_mc.content_panel_mc._width;
  638.          parent_container_height = _root.content_pos_mc.content_panel_mc._height;
  639.       }
  640.       max_content_width = Math.floor(parent_container_width - info_container_width - 40);
  641.       visible_scroller_height = Math.floor(parent_container_height - bm_scroller._y);
  642.       bm_scroller.viewAreaWidth = parent_container_width - 293;
  643.       bm_scroller.viewAreaHeight = Math.floor(visible_scroller_height);
  644.       bm_scroller._x = parent_container_width - 291;
  645.       bm_scroller.setSize(15,visible_scroller_height - 1);
  646.       info_mc._x = Math.floor(parent_container_width - info_container_width);
  647.       info_mc.info_v_line_mc._height = parent_container_height + 2;
  648.       header_line_mc._width = max_content_width;
  649.       legende_mc._x = Math.round(header_line_mc._x + header_line_mc._width - legende_mc._width);
  650.       header_op._width = legende_mc._x - header_op._x - 20;
  651.       subheader_op._width = legende_mc._x - subheader_op._x - 20;
  652.       for(var _loc2_ in bookmark_holder_mc)
  653.       {
  654.          if(bookmark_holder_mc[_loc2_].mc_type == "headline")
  655.          {
  656.             setHeaderWidth(bookmark_holder_mc[_loc2_],max_content_width);
  657.          }
  658.          else if(bookmark_holder_mc[_loc2_].mc_type == "bookmark")
  659.          {
  660.             setBookmarkWidth(bookmark_holder_mc[_loc2_],max_content_width,true);
  661.          }
  662.       }
  663.       local_setpos_changelog = _root.setpos_changelog;
  664.    }
  665. }
  666. function updateScroller()
  667. {
  668.    if(visible_scroller_height < bookmark_holder_mc._height || bm_scroller.visible)
  669.    {
  670.       bm_scroller.setSize(15,visible_scroller_height - 1);
  671.    }
  672. }
  673. function setBookmarkWidth(mc, bm_width, cut_text)
  674. {
  675.    mc.delete_btn_mc._x = bm_width - 22;
  676.    mc.edit_btn_mc._x = bm_width - 44;
  677.    var _loc2_ = bm_width - 44;
  678.    mc.bg_mc._width = _loc2_;
  679.    mc.play_btn_mc._x = _loc2_ - 22;
  680.    mc.time_op._x = _loc2_ - 110;
  681.    mc.date_op._x = _loc2_ - 220;
  682.    mc.text_op._width = Math.max(0,_loc2_ - 220 - mc.text_op._x - 10);
  683.    if(cut_text)
  684.    {
  685.       mc.text_op.text = mc.original_text;
  686.       clearInterval(mc.cut_delay);
  687.       if(mc.text_op._width > 0)
  688.       {
  689.          mc.cut_delay = setTimeout(mc.text_op,"stringCutter_advanced",200," ...");
  690.       }
  691.    }
  692. }
  693. function setHeaderWidth(mc, bm_width, cut_text)
  694. {
  695.    mc.text_op._width = Math.max(0,bm_width - mc.text_op._x);
  696.    if(cut_text)
  697.    {
  698.       mc.text_op.text = mc.original_text;
  699.       clearInterval(mc.cut_delay);
  700.       if(mc.text_op._width > 0)
  701.       {
  702.          mc.cut_delay = setTimeout(mc.text_op,"stringCutter_advanced",200," ...");
  703.       }
  704.    }
  705. }
  706. function createDateString(_date)
  707. {
  708.    var _loc1_ = "";
  709.    if(_date.getDate() >= 10)
  710.    {
  711.       _loc1_ += String(_date.getDate()) + ".";
  712.    }
  713.    else
  714.    {
  715.       _loc1_ += "0" + String(_date.getDate()) + ".";
  716.    }
  717.    var _loc3_ = _date.getMonth() + 1;
  718.    if(_loc3_ >= 10)
  719.    {
  720.       _loc1_ += String(_loc3_) + ".";
  721.    }
  722.    else
  723.    {
  724.       _loc1_ += "0" + String(_loc3_) + ".";
  725.    }
  726.    _loc1_ += String(_date.getFullYear());
  727.    return _loc1_;
  728. }
  729. function createTimeString(_sec)
  730. {
  731.    var _loc1_ = "";
  732.    var _loc2_ = Math.floor(_sec / 60);
  733.    var _loc3_ = _sec - _loc2_ * 60;
  734.    if(_loc2_ >= 10)
  735.    {
  736.       _loc1_ += String(_loc2_) + ":";
  737.    }
  738.    else
  739.    {
  740.       _loc1_ += "0" + String(_loc2_) + ":";
  741.    }
  742.    if(_loc3_ >= 10)
  743.    {
  744.       _loc1_ += String(_loc3_);
  745.    }
  746.    else
  747.    {
  748.       _loc1_ += "0" + String(_loc3_);
  749.    }
  750.    return _loc1_;
  751. }
  752. function setRGB(mc, color)
  753. {
  754.    var _loc1_ = new flash.geom.ColorTransform();
  755.    _loc1_.rgb = color;
  756.    var _loc2_ = new flash.geom.Transform(mc);
  757.    _loc2_.colorTransform = _loc1_;
  758. }
  759. function setBookmarkScrollerVisible()
  760. {
  761.    bm_scroller._visible = true;
  762.    if(local_setpos_changelog != _root.setpos_changelog)
  763.    {
  764.       setLocalPos();
  765.    }
  766.    bookmark_holder_mc._visible = true;
  767. }
  768. function setTextScoller()
  769. {
  770.    info_mc.text_scroller.enabled = true;
  771.    info_mc.text_scroller._visible = true;
  772.    info_mc.text_scroller._x = info_mc.bm_text_bg_mc._x + info_mc.bm_text_bg_mc._width - 16;
  773.    info_mc.text_scroller._y = info_mc.bm_text_bg_mc._y + 2;
  774. }
  775. var local_root_mc = this;
  776. var local_test = false;
  777. var contPath = "config/content.xml";
  778. var video_array = new Array();
  779. var v2b_so = SharedObject.getLocal(_root.so_name,"/");
  780. var bm_y_dis = 25;
  781. var hl_y_dis = 50;
  782. var show_predefined_bm = true;
  783. var parent_container_width = 1025;
  784. var parent_container_heigt = 626;
  785. var info_container_width = 277;
  786. var max_content_width = 720;
  787. var editing_active = false;
  788. var selected_bookmark;
  789. var ftScrollBarMouseListener = new Object();
  790. var visible_scroller_height;
  791. var local_setpos_changelog = -1;
  792. var bmPanelListener = new Object();
  793. info_mc.footer_line_mc._visible = false;
  794. info_mc.bm_header_op.wordWrap = true;
  795. info_mc.bm_header_op.autoSize = true;
  796. info_mc.bmtext_op.wordWrap = true;
  797. info_mc.bm_text_op.autoSize = true;
  798. bm_scroller._visible = false;
  799. info_mc.text_scroller.enabled = false;
  800. info_mc.text_scroller._visible = false;
  801. info_mc.bm_text_bg_mc._visible = false;
  802. info_mc.bm_header_bg_mc._visible = false;
  803. ftScrollBarMouseListener.onMouseWheel = function(delta, scrollTarget)
  804. {
  805.    if(local_root_mc._visible && bm_scroller.enabled)
  806.    {
  807.       if(bm_scroller.oSipDWs.hitTest(_root._xmouse,_root._ymouse,false))
  808.       {
  809.          var _loc3_ = Math.floor(parent_container_height - bm_scroller._y);
  810.          var _loc2_ = Math.ceil(100 * bm_y_dis / (bookmark_holder_mc._height - _loc3_));
  811.          if(_loc2_ > 0)
  812.          {
  813.             if(delta < 1)
  814.             {
  815.                bm_scroller.scrollPercentage = Math.min(100,bm_scroller.scrollPercentage + _loc2_);
  816.             }
  817.             else
  818.             {
  819.                bm_scroller.scrollPercentage = Math.max(0,bm_scroller.scrollPercentage - _loc2_);
  820.             }
  821.          }
  822.       }
  823.    }
  824. };
  825. Mouse.addListener(ftScrollBarMouseListener);
  826.